<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>sha512_256.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="local_closure_goog_crypt_sha512_256.js.html">sha512_256.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2014 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>/**
<a name="line16"></a> * @fileoverview SHA-512/256 cryptographic hash.
<a name="line17"></a> *
<a name="line18"></a> * WARNING:  SHA-256 and SHA-512/256 are different members of the SHA-2
<a name="line19"></a> * family of hashes.  Although both give 32-byte results, the two results
<a name="line20"></a> * should bear no relationship to each other.
<a name="line21"></a> *
<a name="line22"></a> * Please be careful before using this hash function.
<a name="line23"></a> * &lt;p&gt;
<a name="line24"></a> * Usage:
<a name="line25"></a> *   var sha512_256 = new goog.crypt.Sha512_256();
<a name="line26"></a> *   sha512_256.update(bytes);
<a name="line27"></a> *   var hash = sha512_256.digest();
<a name="line28"></a> *
<a name="line29"></a> */
<a name="line30"></a>
<a name="line31"></a>goog.provide(&#39;goog.crypt.Sha512_256&#39;);
<a name="line32"></a>
<a name="line33"></a>goog.require(&#39;goog.crypt.Sha2_64bit&#39;);
<a name="line34"></a>
<a name="line35"></a>
<a name="line36"></a>
<a name="line37"></a>/**
<a name="line38"></a> * Constructs a SHA-512/256 cryptographic hash.
<a name="line39"></a> *
<a name="line40"></a> * @constructor
<a name="line41"></a> * @extends {goog.crypt.Sha2_64bit}
<a name="line42"></a> * @final
<a name="line43"></a> * @struct
<a name="line44"></a> */
<a name="line45"></a>goog.crypt.Sha512_256 = function() {
<a name="line46"></a>  goog.crypt.Sha512_256.base(this, &#39;constructor&#39;, 4,
<a name="line47"></a>      // Section 5.3.6.2 of
<a name="line48"></a>      // csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf
<a name="line49"></a>      [0x22312194, 0xFC2BF72C,  // H0
<a name="line50"></a>       0x9F555FA3, 0xC84C64C2,  // H1
<a name="line51"></a>       0x2393B86B, 0x6F53B151,  // H2
<a name="line52"></a>       0x96387719, 0x5940EABD,  // H3
<a name="line53"></a>       0x96283EE2, 0xA88EFFE3,  // H4
<a name="line54"></a>       0xBE5E1E25, 0x53863992,  // H5
<a name="line55"></a>       0x2B0199FC, 0x2C85B8AA,  // H6
<a name="line56"></a>       0x0EB72DDC, 0x81C52CA2   // H7
<a name="line57"></a>      ]);
<a name="line58"></a>};
<a name="line59"></a>goog.inherits(goog.crypt.Sha512_256, goog.crypt.Sha2_64bit);
</pre>


</body>
</html>
